export default function testHookPlugin() {
  return {
    name: "test-hooks-plugin",
    config(config: any) {
      console.log("config")
    },
    configResolved(resolvedCofnig: any) {
      console.log("configResolved")
    },
    options(opts: any) {
      console.log('options');
      return opts;
    },
    // Vite 独有钩子
    configureServer(server: any) {
      console.log('configureServer');
      setTimeout(() => {
        // 手动退出进程
        process.kill(process.pid, 'SIGTERM');
      }, 3000)
    },
    // 通用钩子
    buildStart() {
      console.log('buildStart');
    },
    // 通用钩子
    buildEnd() {
      console.log('buildEnd');
    },
    // 通用钩子
    closeBundle() {
      console.log('closeBundle');
    }
  }
}